#include "CalculatorTest.h"
#include "Calculator.h"

CPPUNIT_TEST_SUITE_REGISTRATION(CalculatorTest);

CalculatorTest::CalculatorTest() {
}

CalculatorTest::~CalculatorTest() {
}

void CalculatorTest::setUp() {
}

void CalculatorTest::tearDown() {
}

void CalculatorTest::additionTest(){
    c1 = new Calculator("1+2");
    c2 = new Calculator("1.2+2.9");
    c3 = new Calculator("1+9+3");
    c4 = new Calculator("1.258+3.69+10.25");
    c5 = new Calculator("1.0+2.963+3.141592+788");
    
    CPPUNIT_ASSERT_EQUAL(c1.calculate(), 3);
    CPPUNIT_ASSERT_EQUAL(c2.calculate(), 4.1);
    CPPUNIT_ASSERT_EQUAL(c3.calculate(), 13);
    CPPUNIT_ASSERT_EQUAL(c4.calculate(), 15.198);
    CPPUNIT_ASSERT_EQUAL(c5.calculate(), 795.105);
}

